Repository navigation
Conversation
Signed commits reportAll 1 commit between |
a64450e to
7c6a649
Compare
Lists deliveries of an organization or repository webhook, one row per delivery, so dashboards can track webhook success rates and failures. The deliveries endpoint has no time filter and is cursor paginated, so the query pages from the most recent delivery until it reaches the start of the time range, capped at 5000 deliveries. Results that do not cover the whole time range, either because of that cap or because of GitHub's 3-day retention window, carry a warning notice on the frame. Closes grafana#488 Signed-off-by: Aviv Guiser <avivguiser@gmail.com>
7c6a649 to
39e2b74
Compare
itsmylife
left a comment
There was a problem hiding this comment.
I found one issue with the retention warning.
Drafted by Codex, reviewed by Ismail.
| if resp == nil || resp.Cursor == "" { | ||
| // GitHub has nothing older to return, so the deliveries only reach as far back as its retention | ||
| // window does | ||
| result.retentionLimited = oldestDelivered != nil && oldestDelivered.After(timeRange.From) |
There was a problem hiding this comment.
I think this warning can be misleading. If GitHub has no more pages, the oldest delivery being newer than the selected start does not always mean older data was removed. It can also be a new or quiet webhook. Also, if GitHub returns no deliveries for a range older than 3 days, we show no warning at all. Could we check the requested time range for the retention warning and handle the empty result too?
Drafted by Codex, reviewed by Ismail.
itsmylife
left a comment
There was a problem hiding this comment.
I did an agentic review following with a manual review. There is only one point I shared. Also could you please update your branch with the latest main so CI checks run again?
|
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 2 weeks if no further activity occurs. Please feel free to give a status update or ping for review. Thank you for your contributions! |
|
Not stale, will come back to it in 2 weeks |
What
Webhook Deliveriesquery type that lists deliveries of an organization or repository webhook, one row per delivery:delivered_at,event,action,status,status_code,duration,redelivery,repository_id,installation_id, and a derivedsuccessboolean.All/Success/Failure). Leaving the repository empty queries an organization webhook; setting it queries that repository's webhook.Organizations.ListHookDeliveriesandRepositories.ListHookDeliveriesfrom go-github, alongside the existing REST-backed query types.docs/sources/query-editor.md, including the requiredadmin:org_hook/admin:repo_hooktoken scope and GitHub's 3-day delivery retention.Why
Notes for reviewers
repository_idbut no repository name; resolving names would cost an extra request per repository, so the ID is emitted as-is and documented.🤖 Generated with Claude Code